from nicegui import ui
# import userlogin
# from 考试系统.数据交互层 import layoutTools
from 考试系统.数据交互层 import logdir
from 考试系统.数据交互层 import GLOBA
# from niceguiToolkit.layout import inject_layout_tool
# inject_layout_tool()

@ui.page('/')
def new():
    # log ui
    GLOBA.image()
    with ui.card().classes("absolute top-1/4 inset-x-1/3 w-1/3 rounded bg-slate-300 shadow-2xl bg-white opacity-80"):
        # 使用网格布局才能使text-center生效
        label1 = ui.label('欢迎来到考试系统!').style("font-size:2.0rem;color:#f03232;width:100%").tailwind(
            "text-center text-2xl text-dark my-2")
        with ui.column().style("width:100%;flex-direction:column;gap:0.2rem"):
            button1 = ui.button('登录', on_click=lambda: ui.open(logdir.主登录页面.loginmain)).style("align-self:center").tailwind('mx-10 my-3')
            button2 = ui.button('注册', on_click=lambda: ui.open(logdir.注册界面.zhuce)).style(
                "color:#381010;font-size:1.0rem;align-self:center").tailwind('mx-10 my-3')
            ui.button('退出', on_click=lambda: exit()).style("align-self:center").tailwind('mx-10 my-3')
    # label2 = ui.label('label ').style('color: rgb(37 99 235);padding-left: 2.5rem;padding-right: 2.5rem;')